.euiComboBox {
  @include euiFormControlSize(auto, $includeAlternates: true);
  position: relative;

  /**
   * 1. Allow pills to truncate their text with an ellipsis.
   * 2. Don't allow pills to overlap with the caret or clear button.
   * 3. The height on combo can be larger than normal text inputs.
   */

  &--compressed,
  .euiFormControlLayout {
    height: auto;
  }

  .euiComboBox__inputWrap {
    @include euiFormControlStyle($includeStates: false, $includeSizes: true);
    @include euiFormControlWithIcon($isIconOptional: true);
    @include euiFormControlSize(auto, $includeAlternates: true);
    padding: $euiSizeXS $euiSizeS;
    display: flex; /* 1 */

    // sass-lint:disable-block mixins-before-declarations
    // to override the padding added above
    @include euiFormControlLayoutPadding(1); /* 2 */

    &:not(.euiComboBox__inputWrap--noWrap) {
      padding-top: $euiSizeXS;
      padding-bottom: $euiSizeXS;
      padding-left: $euiSizeXS;
      height: auto;  /* 3 */
      flex-wrap: wrap; /* 1 */
      align-content: flex-start;

      &:hover {
        cursor: text;
      }
    }

    &.euiComboBox__inputWrap-isClearable {
      @include euiFormControlLayoutPadding(2); /* 2 */
    }
  }

  /**
   * 1. Force field height to match other field heights.
   * 2. Force input height to expand to fill this element.
   * 3. Reset appearance on Safari.
   * 4. Fix react-input-autosize appearance.
   * 5. Prevent a lot of input from causing the react-input-autosize to overflow the container.
   */
  .euiComboBox__input {
    // sass-lint:disable-block no-important
    display: inline-flex !important; /* 1 */
    height: $euiSizeXL; /* 2 */
    overflow: hidden; /* 5 */

    > input {
      @include euiFont;
      appearance: none; /* 3 */
      padding: 0;
      border: none;
      background: transparent;
      font-size: $euiFontSizeS;
      color: $euiTextColor;
      margin: $euiSizeXS;
      line-height: $euiLineHeight; /* 4 */
    }
  }

  &.euiComboBox-isOpen {
    .euiComboBox__inputWrap {
      @include euiFormControlFocusStyle;

      &--compressed {
        @include euiFormControlFocusStyle($borderOnly: true);
      }
    }
  }

  &.euiComboBox-isInvalid {
    .euiComboBox__inputWrap {
      @include euiFormControlInvalidStyle;
    }
  }

  &.euiComboBox-isDisabled {
    .euiComboBox__inputWrap {
      @include euiFormControlDisabledStyle;
    }
  }

  &.euiComboBox--compressed {
    .euiComboBox__inputWrap {
      line-height: $euiFormControlCompressedHeight; /* 2 */
      padding-top: 0;
      padding-bottom: 0;

      &.euiComboBox__inputWrap-isClearable {
        @include euiFormControlLayoutPadding(2, $compressed: true); /* 2 */
      }
    }
  }
}